FROM buildkite/puppeteer

RUN apt-get update
RUN apt-get install git python gcc g++ make -y
RUN yarn config set registry 'https://registry.npm.taobao.org' 
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

RUN mkdir -p /app/wxp
WORKDIR /app
COPY package.json /app/
RUN yarn --no-cache 
RUN yarn wechaty-puppet-install \
    && rm -rf node_modules/wechaty/node_modules/puppeteer \
    && rm -rf node_modules/puppeteer \
    && yarn cache clean

COPY . /app
RUN yarn build 


CMD [ "node", "dist/src/server" ]
